package javaTec;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * Created by yangshunxing on 2017/7/19.
 */
public class TestSingleThreadExecutor {
    public static void main(String[] args) {
        String content = "主人！您购物车中{{店铺名称}}内的商品，已经等你很久了，请尽快带它回家吧！带它回家：https://cart.ypzdw.com/cart/index";
        int fromIndex = 0;
        while (fromIndex != -1) {
            fromIndex = content.indexOf("$", fromIndex+1);
            String regEx = "\\{\\{[\\u4e00-\\u9fa5]{1,}}}";
            Pattern pattern = Pattern.compile(regEx);
            Matcher m = pattern.matcher(content);
            while( m.find() ){
                String replace = content.substring(m.start(), m.end());
                System.out.println(replace);
                System.out.println(m.start() + "---" + m.end());
            }
            System.out.println(content);
        }}
}
